<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>填写与核对订单</title>
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../css/order.ordersubmit.css">
    <script type="application/javascript" src="../js/jquery-3.3.1.js"></script>
    <script type="application/javascript" src="../js/bootstrap.min.js"></script>
    <script type="application/javascript" src="../layui/layui.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
</head>
<body style="position: static">
    <div id="app" class="bgGray">
        <div data-v-95ac8d30="" class="header3">
            <div data-v-95ac8d30="" class="layout clear">
                <div data-v-95ac8d30="" class="left logo">
                    <a data-v-95ac8d30="" href="loginSuccess">
                        <img data-v-95ac8d30="" src="">
                    </a>
                </div>
                <div data-v-95ac8d30="" class="header3Nav right">|<a data-v-95ac8d30="" href="mymain">我的订单</a>|<a data-v-95ac8d30="" href="helpCenter.html">帮助中心</a>|<a data-v-95ac8d30="" href="loginSuccess">退出</a></div> <div data-v-95ac8d30="" class="header3User right"><i data-v-95ac8d30="" class="iconfont icon-phone"></i><span data-v-95ac8d30="" class="sp1">400-919-8000</span><span data-v-95ac8d30="" class="sp2">欢迎您，</span><span data-v-95ac8d30="" class="sp3"></span></div></div></div>




        <div class="checkOrderTit">
            <div class="layout">
                <div class="checkOrderTitCom">
                    <div class="checkOrderTitComT">
                        <div class="td1 bgRed"></div>
                        <div class="td2 bgRed">1</div>
                        <div class="td3 bgRed"></div>
                        <div class="td2 bgRed">2</div>
                        <div class="td3 bgGray1"></div>
                        <div class="td2 bgGray1">3</div>
                        <div class="td1 bgGray1"></div>
                    </div>
                    <div class="checkOrderTitComB">
                        <div class="bd1 colorRed">选择车辆</div>
                        <div class="bd2 colorRed">填写和核对订单</div>
                        <div class="bd1 colorGray">提交成功</div>
                    </div>
                </div>
            </div>
        </div>

        <div class="orderMsg clear">

            <div class="orderMsgs">
            <div class="orderMsgL left">
                <img :src="infos.picture">
                <p>{{infos.type}}|{{infos.sitnum}}座</p>

            </div>
            <div class="orderMsgR left">
                <div class="carTitle">
                    <span class="carTitle1 left">{{infos.name}}</span>
                </div>

                <div class="selCarMsg">
                    <div class="selCarMsgCom">
                        <div class="MsgTit">取车</div>
                        <div class="Msg">取车地址：{{getcitys.name}}</div>
                    </div>

                    <div class="selCarMsgCom">
                        <div class="MsgTit">还车</div>
                        <div class="Msg">还车地址：{{backcitys.name}}</div>
                    </div>
                </div>
            </div>
                <div class="costCom right">
                    <h3>费用明细</h3>
                    <div class="item">
                        <span class="left" >基本租金</span>
                        <span class="right">{{infos.price}}元</span>
                    </div>
                    <div class="item">
                        <span class="left" >手续费（35元/单）</span>
                        <span class="right">35元</span>
                    </div>
                    <div class="item">
                        <span class="left" >基本保障服务</span>
                        <span class="right">50元</span>
                    </div>
                    <div class="payMony">
                    <label class="right">应付金额&nbsp;
                    <span id="total">{{current()}}</span></label>
                    </div>

                    <button class="buttons right" id="butt" onclick="submitorder()">
                        提交订单
                    </button>




                </div>




        </div>

        </div>
    </div>


    <script type="text/javascript">
        var vm = new Vue({
            el:'.orderMsgs',
            data:{
                infos:'',
                getcitys : '',
                backcitys: ''
            },

            methods:{
                current:function (){
                    var total = 0;
                    var money = 85;
                    total = this.infos.price + money;
                    return total;
        }
            }






        });



    </script>


    <script type="text/javascript">
        $(function(){
            var getid = window.location.search;
            $.ajax({
                type:"get",
                url:"getCity"+getid,
                dataType:"json",
                success:function(data){
                    if(data.statusCode==200) {
                        var infos = data.data;
                        vm.getcitys = infos.getCity;
                        vm.backcitys = infos.backCity;
                    }
                },
                error : function(){
                    alert("ajax加载失败1");
                }

            })
        })

    </script>


    <script type="text/javascript">
        $(function(){

            var getid = window.location.search;
            $.ajax({
                type:"get",
                url:"findCar"+getid,
                dataType:"json",
                success:function(data){
                    if(data.statusCode==200) {
                        vm.infos = data.data;
                    }
                },
                error : function(){
                    alert("ajax加载失败2");
                }

            })
        })
    </script>


    <script type="text/javascript">

        function submitorder() {
            var id = window.location.search;
            var total = $("#total").html();
            $.ajax({
                type:"get",
                url:"addorder"+id + "&oprice="+ total,
                dataType:"json",
                success:function(data){

                    if(data.statusCode==200){
                        alert(data.msg);
                        window.location.href="mymain";
                    }
                 },
                error : function(){
                    alert("ajax加载失败3");
                }

            })
        }

    </script>




</body>
</html>